﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Itop.YHPC.Model;
using System.Text;
using Itop.YHPC.controller;

namespace Itop.YHPC.admin {
    public partial class sysUserAjax : AjaxPage<sysuser> {

        protected override IList<sysuser> onRead() {
            string dwid = Request.QueryString["dwid"];
            string where = null;
            if (!string.IsNullOrEmpty(dwid))
                where = " where dwid='" + dwid + "'";
            return sysuserController.GetList(where);
        }
        protected override bool onCreate(IList<sysuser> list) {
            foreach (sysuser user in list) {
                user.id = user.CreateID();
                sysuserController.Insert(user);
            }
            return true;
        }
        protected override bool onUpdate(IList<sysuser> list) {
            foreach (sysuser user in list) {
                
                sysuserController.Update(user);
            }
            return true;
        }

        protected override bool onDelete(IList<sysuser> list) {
            foreach(sysuser user in list){
                sysuserController.Delete(user.id);
            }
            return true;
        }
    }
}
